<template>
	<view>
		<goodslist :goods="goods"></goodslist>
		<view class="bottom" v-if="isFlag">--------------------触底啦-------------------</view>
	</view>
</template>

<script>
	import goodslist from "../../components/goodslist/goodlist.vue"
	export default {
		components:{
			goodslist
		},
		data() {
			return {
				goods:[],
				isFlag:false
			}
		},
		methods: {
			async getGoods(type,page){
				const res = await this.$myRequest2({
					url:'/home/data',
					data:{
						type,page
					}
				}).then((res)=>{
					console.log('!!!!!!!!!!!!!')
					console.log(res)
					this.goods = res.data.data.list
					// console.log(this.goods[0].show)
				})
			}
		},
		onLoad() {
			this.getGoods('sell','2'),
			console.log(this.isFlag)
		},
		onReachBottom() {
			this.isFlag =true;
			console.log(this.isFlag)
			
		}
	}
</script>

<style lang="scss">
.bottom{
	
		padding:0 auto ;
	
}
</style>
